package com.zang.blogz.model.output;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Author: 橘贝贝
 * @Description:
 * @DateTime: 2022/6/29 15:13
 **/
@Data
public class CommentVO {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("评论用户Id")
    @TableField("user_id")
    private Integer userId;

    @ApiModelProperty("评论文章id")
    @TableField("article_id")
    private Integer articleId;

    @ApiModelProperty("评论内容")
    @TableField("comment_content")
    private String commentContent;

    @ApiModelProperty("回复用户id")
    @TableField("reply_user_id")
    private Integer replyUserId;

    @ApiModelProperty("父评论id")
    @TableField("parent_id")
    private Integer parentId;

    @ApiModelProperty("是否删除  0否 1是")
    @TableField("is_delete")
    private Boolean isDelete;

    @ApiModelProperty("是否审核")
    @TableField("is_review")
    private Boolean isReview;

    @ApiModelProperty("子评论")
    private List<CommentVO> childrenCommentVo;

    @ApiModelProperty("评论时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date updateTime;
}
